import java.util.Scanner;

public class Main {
    public  static User login (){
        System.out.println("请输入你的姓名");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("请选择你的身份");
        System.out.println("1 管理员    2 普通人");

        int choice = scanner.nextInt();
        if(choice==1){
            return new Manger(name);
        }
        else{
            return new Normal(name);
        }
    }
    public static void main(String[] args) {

        User user = login();
        user.printMenu();
        Scanner scanner =new Scanner(System.in);
        int choice = scanner.nextInt();
        BookList bookList = new BookList();
        while(choice != 0) {
            //user.a(choice,bookList);
            user.userFunc[choice].work(bookList);
            System.out.println(user.prit);

            choice = scanner.nextInt();
        }



    }
}